home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / earcd / comm / cnet / 1oo_coff.lha / LOGOFF.rexx < prev    next >
OS/2 REXX Batch file  |  1997-02-20  |  6KB  |  26 lines

  1. /*          $VER: 1oo_cOFF v1.0b (20-Feb-97) by Adolescent/1oo%         
  2.                    _____.  __________.  __________. __ _____
  3.                   /     |_/   ___    |_/   ___    | \//    /
  4.                   |     ||     \/    ||     \/    |  /    /
  5.                   |     ||     /     ||     /     | /    /__
  6.                   |____/~|__________/~|__________/~ \___/ \/              */
  7.  
  8.  
  9. x =05;y =50                          /* X / Y CO-ORDINATES FOR THE MATRIX */
  10. xx=22;yy= 0                          /* X / Y CO-ORDINATES FOR THE DESC.  */
  11.  
  12. c.1=7                                /* COLORS:        MATRIX             */
  13. c.2=8                                /*           DESCRIPTION LINE        */
  14. c.3=14                               /*               SELECTED            */
  15.  
  16. min=30                               /* MINIMUM ACCESS FOR CONFIGURE ED.  */
  17.  
  18. cfg='LOGOFF.cfg'                     /* THE CONFIG FILE, AUTO. CREATED    */
  19.  
  20. /* THE 1oo% HOMEPAGE AT http://rummelplatz.uni-mannheim.de/~mics/100.html */
  21.  
  22.  
  23.  
  24.  
  25.  
  26. x=05;y=50;xx=22;yy=0;c.1=7;c.2=8;c.3=14;min=30;cfg='LOGOFF.cfg';options results;signal on SYNTAX;signal on ERROR;signal on IOERR;tr=transmit;se=sendstring;gc=getchar;gu=getuser;mg=maygetchar;a='rexxsupport.library';if ~show('l',a) then if ~addlib(a,0,-30) then exit;bbsidentify name;bbs=result;bbsidentify sysop;sys=result;gu 1;han=result;gu 15;acc=result;gu 23;por=result;gu 1307358;com=result;parse source . . fp .;path=left(fp,max(lastpos('/',fp),lastpos(':',fp)));changewhere 'Logging Off';START:;opt=1;opt.='';act.='';dis.='';if right(strip(com,'B'),1)='!' then;do;call dumpuser(por,4,1);exit;end;se '* systext:sys.logoff}';if ~exists(path||cfg) then;do;call open(new,path||cfg,'W');call writeln(new,'¹leave^Stick a fork in me...  Im done!^DUMP');call writeln(new,'¹abort^I couldnt possibly leave 'bbs'.^QUIT');call writeln(new,'¹feedback^Ramble on to 'sys'.^& FEEDBACK!}');call close(new);end;call open(set,path||cfg,'R');do until eof(set);dat=readln(set);parse var dat '¹' opt.opt '^' dis.opt '^' act.opt;opt=opt+1;end;call close(set);opt=opt-2;if opt>8 then opt=8;if opt=3 then x=x+1;if opt=4|opt=5 then x=x;if opt=6|opt=7|opt=8 then x=x-1;do z=1 to opt;tr at(x+z,y)'c'c.1'}'center(opt.z,28);end;z=1;DISPLAY:;tr at(x+z,y)'o1}c'c.3'}'center(upper(opt.z),28)'o0}';se at(xx,yy)'@4c'c.2'}'center(dis.z'',83,' ')'f0';SELECT:;c=check(getcursor());if c=2&z ~=opt then;do;tr at(x+z,y)'c'c.1'}'center(opt.z,28);z=z+1;signal DISPLAY;end;if c=8&z ~=1 then;do;tr at(x+z,y)'c'c.1'}'center(opt.z,28);z=z-1;signal DISPLAY;end;if c=5 then signal CHOOSE;if c='A'|c='Q' then signal QUIT;if c='F' then;do;z=3;signal CHOOSE;end;if c='Y' then;do;z=1;signal CHOOSE;end;if c='C'&acc>=min then signal CONFIG;call SELECT;CHOOSE:;tr 'f1';if act.z='QUIT' then signal QUIT;if act.z='DUMP' then;do;call dumpuser(por,5,0);addkeys '`';exit;end;se act.z;signal START;exit;SYNTAX:;ERROR:;IOERR:;e1=' c9Errorcf: ca'rc' cf(ca'errortext(rc)'cf)';e2='  c9Linecf: ce'left(sigl,4)'c9Filecf:';gu 1311992;a=result;gu 1311960;b=result;c='cb"ce'a||b'cb"';e2=e2' 'c;tr e1;tr e2;logentry e1;logentry e2;e=sourceline(sigl);do while e~='';e3='c9Sourcecf: cd';e3=e3||left(e,37);tr e3;logentry e3;e=substr(e,38);end;bufferflush;exit;AT:;return ''arg(1)';'arg(2)'H';CHECK:;if ARG()&ARG(1)~='###PANIC' then return ARG(1);getcarrier;if result='TRUE' then if ARG() then return ARG(1);else return;logentry 'Lost Carrier!!';bufferflush;exit;GETCURSOR:procedure;do until key~='NOCHAR';maygetchar;key=result;end;if key='1B'x then;do 2;maygetchar;key=result;end;else if key='D'x then return '5';else return upper(key);if key='A' then return '8';if key='B' then return '2';if key='C' then return '6';if key='D' then return '4';return upper(key);QUIT:;tr at(21,0)'';exit;CONFIG:;tr 'f1}z4}cf} 1oo_cOFF Online Configurator                       (c) 1996 by Adolescent/1oo z0}n1}';tr 'c7}#.  option (20)           action (40)                             ';tr 'c7}    description (70)c6}';do z=1 to opt;act.z=strip(act.z,'B','}');tr z'.  'left(opt.z,20)'  'left(act.z,40);tr '    'left(dis.z,70);end;tr at(24,1)'c7}Enter cf}#c7} (edit/add/max 8) cf}Dc7}elete cf}Sc7}ave cf}Qc7}uit:  cb}g1}';gu 71;edd=result;if index('12345678DQS',edd)=0 then signal CONFIG;if edd='Q' then signal START;if edd='S' then signal SAVE;if edd='D' then signal DELETE;if edd>opt then;do;opt=opt+1;edd=opt;end;tr at(24,1)'c7}Editing OPTION 'edd'c6}';tr at(24,1)center('This is the name of the item that will be shown on the menu.',82);tr at(3+(edd*2),1)edd'.  cf}I6272 20}';gu 70;ent=result;if ent>'' then opt.edd=ent;if edd<3 then tr at(24,1)'c1}  CHANGING THE DEFAULT ACTIONS OF OPTIONS 1-3 CAN AFFECT PROGRAM OPERATION!';else;tr at(24,1)center('c7}Actions must be MCI commands minus the brackets (ex. #2PFILES:BBSLIST)',82);tr at(3+(edd*2),27)'cf}I6528 40}';gu 70;ent=result;if ent>'' then act.edd=ent;tr at(24,1)center('c7}This is the description text you see at the bottom of the screen.',82);tr at(4+(edd*2),5)'cf}I6272 70}';gu 70;ent=result;if ent>'' then dis.edd=ent;signal CONFIG;DELETE:;tr at(23,1)'c1}  CHANGING THE DEFAULT ACTIONS OF OPTIONS 1-3 CAN AFFECT PROGRAM OPERATION!';tr at(24,1)'c7}Delete which line?  c6}g1}';gu 71;edd=result;if index('0123456789DQS',edd)=0|edd>opt then signal CONFIG;bad=0;do z=1 to opt;if z=edd then iterate;bad=bad+1;opt.bad=opt.z;dis.bad=dis.z;act.bad=act.z;end;opt=opt-1;signal CONFIG;SAVE:;tr at(24,1)'c7}Really okay to save?  c6}g1}';gu 71;if result ~='Y' then signal CONFIG;call open(new,path||cfg,'W');do z=1 to opt;if act.z='DUMP'|act.z='QUIT' then call writeln(new,'¹'opt.z'^'dis.z'^'act.z);else;call writeln(new,'¹'opt.z'^'dis.z'^'act.z'}');end;call close(new);signal START;DUMPUSER:procedure;arg p,d,q;if q~=1 then q=0;getportid p;if result=-1|~datatype(p,'W')|~datatype(d,'W')|d<0|d>11 then return 0;address ('CNETREXX'p);sendstring 'L1109799 #'q'}L1200022 #'d'}L1109807 #1}';addkeys '`';return 1